import tkinter as tk
from tkinter import  simpledialog

class CustomAskStringDialog(simpledialog.Dialog):
       def __init__(self, parent, title, prompt, initialvalue):
           self.initialvalue = initialvalue
           super().__init__(parent, title)
       def body(self, master):
           tk.Label(master, text=self.title()).pack()
           self.entry = tk.Entry(master)
           self.entry.pack()
           if self.initialvalue:
               self.entry.insert(0, self.initialvalue)
           return self.entry
       def apply(self):
           self.result = self.entry.get()


